package com.wzz.demo.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("user")
public class UserController {

    @GetMapping("insert")
    @PreAuthorize(value = "hasAuthority('user:insert')")
    public String insert() {
        return "insert";
    }

    @GetMapping("delete")
    @PreAuthorize(value = "hasAuthority('user:delete')")
    public String delete() {
        return "delete";
    }

    @GetMapping("update")
    @PreAuthorize(value = "hasAuthority('user:update')")
    public String update() {
        return "update";
    }

    @GetMapping("query")
    @PreAuthorize(value = "hasAuthority('user:query')")
    public String query() {
        return "query";
    }

    @GetMapping("export")
    @PreAuthorize(value = "hasAuthority('user:export')")
    public String export() {
        return "export";
    }
}
